/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cc.altius.service.impl;

import cc.altius.dao.HospitalDao;
import cc.altius.model.*;
import cc.altius.service.HospitalService;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * @author sagar
 */
@Service
public class HospitalServiceImpl implements HospitalService {

    @Autowired
    private HospitalDao hospitalDao;

    @Override
    public int addHospital(Hospital hospital) {
        return this.hospitalDao.addHospital(hospital);
    }

    @Override
    public int updateHospital(Hospital hospital, int hospitalId) {
        return this.hospitalDao.updateHospital(hospital, hospitalId);
    }

    @Override
    public List<Hospital> getHospitalList() {
        return this.hospitalDao.getHospitalList();
    }

    @Override
    public Hospital getHospitalById(int hospitalId) {
        System.out.println("inside getHospitalById of serviceimpl");
        return this.hospitalDao.getHospitalById(hospitalId);
    }

    @Override
    public List<Zone> getZoneList() {
        return this.hospitalDao.getZoneList();
    }

    @Override
    public Zone getZoneById(int zoneId) {
        return this.hospitalDao.getZoneById(zoneId);
    }

    @Override
    public Hospital getHospitalByHospitalName(String hospitalName) {

        return this.hospitalDao.getHospitalByHospitalName(hospitalName);
    }

    @Override
    public boolean existHospitalByHospitalName(String hospitalName) {

        if (this.hospitalDao.getHospitalByHospitalName(hospitalName) == null) {

            return false;
        } else {

            return true;
        }
    }

    @Override
    public List<Hospital> getHospitalByZoneId(int zoneId) {
        return this.hospitalDao.getHospitalByZoneId(zoneId);
    }

    @Override
    public List<Map<String, Object>> getListOnZipCode(String zipCode) {
        return this.hospitalDao.getListOnZipCode(zipCode);
    }

    @Override
    public List<Map<String, Object>> getFilterHospital(int stateId, int cityId, int masterZoneId, int zoneId,int tieUpId) {
        return this.hospitalDao.getFilterHospital(stateId, cityId, masterZoneId, zoneId,tieUpId);
    }

    @Override
    public int addZip(ZipCodeArea zipCodeArea) {
        return this.hospitalDao.addZip(zipCodeArea);
    }

    @Override
    public ZipCodeArea getZipCodeById(int zipCodeId) {
        return this.hospitalDao.getZipCodeById(zipCodeId);
    }

    @Override
    public List<ZipCodeArea> getzipCodeList() {
        return this.hospitalDao.getzipCodeList();
    }

    @Override
    public int updateZip(ZipCodeArea zipCodeArea, int zipCodeId) {
        return this.hospitalDao.updateZip(zipCodeArea, zipCodeId);
    }

    @Override
    public ZipCodeArea getZipCodeByZipCode(String zipCode) {
        return this.hospitalDao.getZipCodeByZipCode(zipCode);
    }

    @Override
    public boolean existZipCodeByZipCode(String zipCode) {
        if (this.hospitalDao.getZipCodeByZipCode(zipCode) == null) {
            System.out.println("inside if ");
            return false;
        } else {
            System.out.println("inside else");
            return true;
        }
    }

    @Override
    public List<HealthSpringCenter> getCenterList() {
        return this.hospitalDao.getCenterList();
    }

    @Override
    public List<Hospital> hospitalListForAutoComplete(String hospitalName) {
        return this.hospitalDao.hospitalListForAutoComplete(hospitalName);
    }
    
     @Override
    public List<Hospital> smsHospitalListForAutoComplete(String hospitalName) {
        return this.hospitalDao.smsHospitalListForAutoComplete(hospitalName);
    }
}
